package com.atguigu.controller;

import com.atguigu.mapper.UserMapper;
import com.atguigu.pojjo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/my")
public class MybatisController {

    @Autowired
    UserMapper userMapper;

    @ResponseBody
    @GetMapping("/getUser")
    public List<User> getUser(){
        return userMapper.selectList(null);
    }

}
